<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="./vue.js"></script>
</head>

<body>
  <div id="app">
    <!-- .stop的使用 -->
    <h1 style="background-color: red;" @click="divClick">
      <button @click.stop="btnClick">111</button>
    </h1>
    <br>
    <form action="baidu">
      <!-- 我们希望来手动提交 -->
      <input type="submit" value="提交" @click.prevent="submitClick">
    </form>
    <!-- 键盘点击事件 监听某个按键的按钮点击 -->
    <input type="text" @keyup.enter="keyup">
    <input type="text" @keyup.enter.once="keyup1">
  </div>
  <script>
    var vm = new Vue({
      el: '#app',
      data: { name: 'Taec' },
      methods: {
        btnClick() {
          console.log('Click');
        },
        divClick() {
          console.log('DIV');
        },
        submitClick() {
          console.log('submit');

        },
        keyup() {
          console.log('key');
        },
        keyup1() {
          console.log('key11111');
        }
      }
    })
  </script>
</body>

</html>